#pragma once
#include <nice2d/entity.h>

class DraggableEntity : public Entity
{
    DECLARE_OBJECT(DraggableEntity)
public:
    DraggableEntity(const sf::Vector2f& size = sf::Vector2f());
    ~DraggableEntity();
public:
    void setDragable(bool dragable);
    bool isDragable();
    boost::signals2::signal<void(bool)> dragableChanged;

    void setResizeable(bool resizeable);
    bool isResizeable()const;
    boost::signals2::signal<void(bool)> resizeableChanged;

    void setTarget(EntityPointer target);
private:
    virtual void onMousePressed(sf::Mouse::Button button)override;
    virtual void onMouseMoved(int x,int y)override;
private:
    std::unique_ptr<class DraggableEntityData> data;
};
